<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/metinfo.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/cookie.js"></script>
<script type="text/javascript">
	var bnt_txt1 = "获取Meta信息";
	var bnt_txt2 = "网站已经存在";

	$(function() {
			$('table tr').each(function(i, obj) {
			$(obj).find('td').eq(0).addClass("text");
			$(obj).find('td').eq(1).addClass("input");
			$(obj).find('td').eq(1).children('input').addClass('text nonull');
			$(obj).find('td').eq(1).children('textarea').addClass('textarea gen');
		});
		$('#getmeta').bind('click', function() {
			var weburl = $('#weburl').val();
			$.post('{:U("Site/ajaxCheck")}', {
				action : "updatemeta",
				weburl : weburl,
				seid : $('#seid').val(),
				webid : {$Think.get.id},
			}, function(data) {
				if (data) {
					$('#weburl').attr('class', 'pass');
					$('#pages').val(data.pages);
					$('#unlinks').val(data.unlinks);
					$('#snapshot').val(data.snapshot);
				} else {
					$('#weburl').attr('class', 'error');
				}
			})
		})
	})
	function upd(field) {
		var field = field;
		var value = $('#' + field).val();

		$.post('{:U("Site/ajaxCheck")}', {
			action : "savemeta",
			seid : $('#seid').val(),
			webid : {$Think.get.id},
			field:field,
			value:value
		}, function(data) {
			alert(data);
		})
	}
</script>
<style type="text/css">
/*
input,textarea {
	border: 1px solid #CDCDCD;
	padding: 4px;
}

.error {
	border-color: red;
	background-color: #FFDDDD;
	color: red;
}

.pass {
	border-color: green;
	background-color: #DEFEE4;
	color: green;
}

.abnt {
	border: 1px solid black;
	padding: 3px;
	font-size: 12px;
}

* {
	font-family: consolas;
	font-size: 12px;
}*/
</style>
</head>
<body>
	<div class="metinfotop">
		<div class="position">简体中文：内容管理 > <a href="">内容管理</a> > <a href=''>文章管理</a></div>
		<div class="return"><a href="">&lt;&lt;返回</a></div>
	</div>
	<div class="clear"></div>
	<form action="{$url}" method="post">
	<table cellpadding="2" cellspacing="1" class="table">
		<tr>
			<td>网站地址：</td>
			<td><input type="text" style="width: 300px;" id="weburl"
				name="webinfo[weburl]" value="{$info.weburl}" /></td>
		</tr>
		<tr>
			<td>网站名称：</td>
			<td><input style="width: 300px;" type="text" id="webname"
				name="webinfo[webname]" value="{$info.webname}" /></td>
		</tr>
		<tr>
			<td>网站标题：</td>
			<td><input style="width: 300px;" type="text" id="webmetatitle"
				name="webinfo[webmetatitle]" value="{$info.webmetatitle}" /></td>
		</tr>
		<tr>
			<td>网站关键字：</td>
			<td><textarea name="webinfo[webmetakeys]" cols="40"
					id="webmetakeys">{$info.webmetakeys}</textarea></td>
		</tr>
		<tr>
			<td>网站描述：</td>
			<td><textarea name="webinfo[webmetadesc]" cols="40"
					id="webmetadesc">{$info.webmetadesc}</textarea></td>
		</tr>
		<tr>
			<td>搜索引擎类型：</td>
			<td><select name="cominfo[seid]" id="seid"><option value="1">百度</option><option value="2">谷歌</option></select>&nbsp;&nbsp;<a
				class="abnt" id="getmeta">更新</a></td>
		</tr>
		<tr>
			<td>网站收录：</td>
			<td><input type="text" id="pages" name="cominfo[pages]"
				value="{$info.pages|default=0}" />&nbsp;&nbsp;<a class="abnt"
				onclick="upd('pages')">更新至数据库</a></td>
		</tr>
		<tr>
			<td>网站反链：</td>
			<td><input type="text" id="unlinks" name="cominfo[unlinks]"
				value="{$info.unlinks|default=0}" />&nbsp;&nbsp;<a class="abnt"
				onclick="upd('unlinks')">更新至数据库</a></td>
		</tr>
		<tr>
			<td>网站快照：</td>
			<td><input type="text" id="snapshot" name="cominfo[snapshot]"
				value="{$info.snapshot|date='Y-m-d',###}" />&nbsp;&nbsp;<a class="abnt"
				onclick="upd('snapshot')">更新至数据库</a></td>
		</tr>
		<tr>
			<td><input type="reset" class="submit" value="reset"></td>
			<td><input type="submit" name="submit" class="submit" value="submit"></td>
		</tr>
	</table>
</body>
</html>